package edu.pku.sei.transformation.mtparser;

import lpg.runtime.*;

/**
 *<b>
 *<li>Rule 20:  IfExpr ::= if LogicSemanticsExpr then SingleExpr else SingleExpr endif
 *</b>
 */
public class IfExpr1 extends Ast implements IIfExpr
{
    private ILogicSemanticsExpr _LogicSemanticsExpr;
    private ISingleExpr _SingleExpr;
    private ISingleExpr _SingleExpr6;

    public ILogicSemanticsExpr getLogicSemanticsExpr() { return _LogicSemanticsExpr; }
    public ISingleExpr getSingleExpr() { return _SingleExpr; }
    public ISingleExpr getSingleExpr6() { return _SingleExpr6; }

    public IfExpr1(IToken leftIToken, IToken rightIToken,
                   ILogicSemanticsExpr _LogicSemanticsExpr,
                   ISingleExpr _SingleExpr,
                   ISingleExpr _SingleExpr6)
    {
        super(leftIToken, rightIToken);

        this._LogicSemanticsExpr = _LogicSemanticsExpr;
        this._SingleExpr = _SingleExpr;
        this._SingleExpr6 = _SingleExpr6;
        initialize();
    }

    public boolean equals(Object o)
    {
        if (o == this) return true;
        if (! (o instanceof IfExpr1)) return false;
        if (! super.equals(o)) return false;
        IfExpr1 other = (IfExpr1) o;
        if (! _LogicSemanticsExpr.equals(other._LogicSemanticsExpr)) return false;
        if (! _SingleExpr.equals(other._SingleExpr)) return false;
        if (! _SingleExpr6.equals(other._SingleExpr6)) return false;
        return true;
    }

    public int hashCode()
    {
        int hash = super.hashCode();
        hash = hash * 31 + (_LogicSemanticsExpr.hashCode());
        hash = hash * 31 + (_SingleExpr.hashCode());
        hash = hash * 31 + (_SingleExpr6.hashCode());
        return hash;
    }

    public void accept(Visitor v) { v.visit(this); }
    public void accept(ArgumentVisitor v, Object o) { v.visit(this, o); }
    public Object accept(ResultVisitor v) { return v.visit(this); }
    public Object accept(ResultArgumentVisitor v, Object o) { return v.visit(this, o); }
}


